package nahuel.games.carracer;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;

public class DialogActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
		setContentView(R.layout.activity_dialog);
		
		TextView dialogText = (TextView) findViewById(R.id.dialogText);
		Button dialogBut = (Button) findViewById(R.id.dialogBut);

		Intent intent = getIntent();
		String objetivo = intent.getStringExtra(MainActivity.EXTRA_OBJETIVO);
		String resultado = intent.getStringExtra(Juego.EXTRA_RESULT);

		if(objetivo != null){
			dialogText.setText((CharSequence) objetivo);
			dialogBut.setText("Comenzar");
		}
		if(resultado != null){
			dialogText.setText((CharSequence) resultado);
			dialogBut.setText("Nuevo Juego");
		}
		
	}

	public void finalizar(View view){
		finish();
	}
}
